<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>角色设置</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/public.css" media="all" />
	<script type="text/javascript" src="../../layui/layui.js"></script>
</head>
<body class="childrenBody">
<!--新增角色按钮-->
<form class="layui-form " action="" method="post" id="addFrm" lay-filter="addFrm">
	<button type="button" class="layui-btn add_btn layui-btn-normal" id="add_btn" lay-filter="add_btn"><i class="layui-icon">&#xe608;</i>新增角色</button>
</form>
<!--数据表格开始-->
<div class="layui-col-md6" style="margin-top: 10px"><!--yw 确定宽度-->
	<table id="list" lay-filter="list" ></table><!--yw 显示列表数据-->
	<!--行工具条-->
	<div id="listRowBar" style="display:none;">
<!--		<a lay-event="edit"><i class="layui-icon" >&#xe642;</i>编辑后台权限</a>-->
<!--		<a lay-event="del"><i class="layui-icon" >&#xe640;</i>删除</a>-->

		<a lay-event="edit"><i class="layui-icon" >&#xe642;</i></a>
		<a lay-event="del"><i class="layui-icon" >&#xe640;</i></a>
	</div>
</div>
<!--数据表格结束-->

<!-- 新增角色弹出层开始-->
<div style="display:none;padding:10px" id="addDiv">
	<form action="" method="post" class="layui-form" id="dataFrm1" lay-filter="dataFrm1">
		<div class="layui-form-item">
			<label class="layui-form-label"><span style="color:red;">*</span>角色ID</label>
			<div class="layui-input-block">
				<input type="text" name="roleid2" placeholder="请输入角色id编号" autocomplete="off" class="layui-input" id="roleid2" lay-verify="required|number|lenLimit20|examine">
				<div class="layui-form-mid layui-word-aux">请输入不重复的id编号</div>
			</div>
		</div>
		<div class="layui-form-item">
		<label class="layui-form-label"><span style="color:red;">*</span>角色名称</label>
		<div class="layui-input-block">
			<input type="text" name="rolename2" placeholder="请输入角色名称" autocomplete="off" class="layui-input" id="rolename2" lay-verify="required|lenLimit20|examine">
		</div>
	</div>
		<div class="layui-form-item">
			<div class="layui-input-block" style="text-align: center;">
				<button type="button" class="layui-btn" lay-submit id="doSubmitAdd" lay-filter="doSubmitAdd"><i class="layui-icon">&#xe605;</i>确认</button>
				<button type="reset" class="layui-btn layui-btn-warm" ><i class="layui-icon">&#xe669;</i>重置</button>
			</div>
		</div>
	</form>
</div>
<!--新增角色弹出层结束-->


<!-- 编辑权限弹出层开始-->
<div style="display:none;padding:10px" id="edit">
	<form action="" method="post" class="layui-form" id="dataFrm2" lay-filter="dataFrm2">
		<div class="layui-form-item">
			<label class="layui-form-label">复选框</label>
			<div class="layui-input-block">
			<input type="checkbox" name="close" lay-skin="switch"  id="c_all"  lay-filter="switchTest"  lay-text="网关管理">
			<br/><br/>
			<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="添加网关" value="10001">
			<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="编辑网关" value="10001">
			<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="查看网关" value="10001">
		</div>
			<br>
			<div class="layui-input-block">
				<input type="checkbox" name="close" lay-skin="switch"  id="c_all1"  lay-filter="switchTest"  lay-text="网关管理">
				<br/><br/>
				<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="添加网关" value="10001">
				<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="编辑网关" value="10001">
				<input type="checkbox" name="cityId" lay-skin="primary" lay-filter="c_one" class="cityId"  title="查看网关" value="10001">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block" style="text-align: center;">
				<button type="button" class="layui-btn" lay-submit id="doSubmitSave" lay-filter="doSubmitSave"><i class="layui-icon">&#xe605;</i>确认</button>
				<button type="reset" class="layui-btn layui-btn-warm" ><i class="layui-icon">&#xe669;</i>取消</button>
			</div>
		</div>
	</form>
</div>

<script>
	layui.use('form', function () {
		var form = layui.form;
		//全选 全不选
		form.on('switch(c_boolean)', function (data) {

			var item = $(".cityId");
			item.each(function () {
				if ($(this).prop("checked")) {
					$(this).prop("checked", false);
				} else {
					$(this).prop("checked", true);
				}
			});
			form.render('checkbox');
		})
	});

</script>
<!--编辑权限弹出层结束-->

	<script type="text/javascript" src="roleSetupList.js"></script>
</body>
</html>
